<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>

<html>
<head>
<style>
.error {
	color: #ff0000;
}

.errorblock {
	color: #000;
	background-color: #ffEEEE;
	border: 3px solid #ff0000;
	padding: 8px;
	margin: 16px;
}
</style>
</head>

<body>
	<h2>Customer Registration</h2>

	<form:form method="POST" commandName="customer" >

		<form:errors path="*" cssClass="errorblock" element="div" />

		<table>
			<tr>
				<td><form:label path="firstName">
						<spring:message code="CustomerRegistration.label.firstName" />
					</form:label></td>
				<td><form:input path="firstName" /></td>
				<td><form:errors path="firstName" cssClass="error" /></td>
			</tr>

			<tr>
				<td><form:label path="lastName">
						<spring:message code="CustomerRegistration.label.lastName" />
					</form:label></td>
				<td><form:input path="lastName" /></td>
				<td><form:errors path="lastName" cssClass="error" /></td>
			</tr>

			<tr>
				<td><form:label path="birthDate">
						<spring:message code="CustomerRegistration.label.birthDate" />
					</form:label></td>
				<td><form:input path="birthDate" value="1982/09/01" /></td>
				<td><form:errors path="birthDate" cssClass="error" /></td>
			</tr>

			<tr>
				<td><form:label path="gender">
						<spring:message code="CustomerRegistration.label.gender" />
					</form:label></td>
				<td><form:radiobutton path="gender" value="M" />Male <form:radiobutton
						path="gender" value="F" />Female</td>
				<td><form:errors path="gender" cssClass="error" /></td>
			</tr>

			<tr>
				<td><form:label path="userName">
						<spring:message code="CustomerRegistration.label.userName" />
					</form:label></td>
				<td><form:input path="userName" /></td>
				<td><form:errors path="userName" cssClass="error" /></td>
			</tr>

			<tr>
				<td><form:label path="password">
						<spring:message code="CustomerRegistration.label.password" />
					</form:label></td>
				<td><form:password path="password" /></td>
				<td><form:errors path="password" cssClass="error" /></td>
			</tr>

			<tr>
				<td><form:label path="cpassword">
						<spring:message code="CustomerRegistration.label.cpassword" />
					</form:label></td>
				<td><form:password path="cpassword" /></td>
				<td><form:errors path="cpassword" cssClass="error" /></td>
			</tr>

			<tr>
				<td><form:label path="newsletter">
						<spring:message code="CustomerRegistration.label.newsletter" />
					</form:label></td>
				<td><form:checkbox path="newsletter" /></td>
				<td><form:errors path="newsletter" cssClass="error" /></td>
			</tr>

			<tr>
				<td colspan="3"><input type="submit" /></td>
			</tr>
		</table>
	</form:form>

</body>
</html>